package com.dgw.springbootrabbitmq.controller;

import com.dgw.springbootrabbitmq.sender.DirectSender;
import com.dgw.springbootrabbitmq.sender.TaskSender;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: spring-boot-rabbitmq
 * @description:
 * @author: Mr.Dai
 * @create: 2020-02-20 17:20
 **/
@RestController
public class TestController {

    @Autowired
    private DirectSender directSender;

    @Autowired
    private TaskSender taskSender;

    @GetMapping("/testDirect")
    public String testDirect(){
        directSender.sendDirectQueue();
        return "SUCCESS";
    }

    @GetMapping("/testTask")
    public String testTask(){
        taskSender.send();
        return "SUCCESS";
    }
}
